import http from "@/config/http.js"

export default {
	//所有信息
	async getprodinfo(data) {
		try {
			let res = await http.post("/pro/findAll", data)
			return res
		} catch (err) {
			alert(err)
		}
	},
	//添加信息
	async addproinfo(data) {
		try {
			let arr = {
				data: data
			}
			let res = await http.post("/pro/save", arr)
			return res
		} catch (err) {
			alert(err)
		}
	},
	//删除
	delProinfo(val) {
		let data = {
			id: val
		}
		return http.post("/pro/delete", data)
	},
	//编辑
	async exitProinfo(data) {
		try {
			let res = await http.post("/pro/update", data);
			return res
		} catch (err) {
			alert(err)
		}
	},
	//查询所有信息无size
	async getProinfoall() {
		try {
			let data = {
				code: 0,
				data: {},
				extraMsg: '',
				msg: ''
			}
			let res = await http.post("/pro/findAll/noSize", data)
			return res
		} catch (err) {
			alert(err)
		}
	},
	//查询得到城市信息
	async getCity(){
		try {
			let res = await http.get("/region/findTree")
			return res
		} catch (err) {
			alert(err)
		}
	},
	//根据id查看单个项目信息
	async showProItem(data) {
		try {
			let res = await http.post("/pro/findProDataById", data);
			return res.data
		} catch (err) {
			alert(err)
		}
	},
}

